package com.pm25.request;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.pm25.exception.ValidateException;
import com.pm25.response.StationNamesResponse;

public class StationNamesRequest implements Request<StationNamesResponse> {
	private String city;
	
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public void valid() throws ValidateException {
		if (StringUtils.isBlank(city)) {
			throw new ValidateException("城市名称不能为空");
		}
	}

	public Map<String, String> getParamterMaps() {
		Map<String, String> param = new HashMap<>();
		param.put("city", city);
		return param;
	}

	public String getUri() {
		return "/api/querys/station_names.json";
	}

	public Class<StationNamesResponse> getResponseClass() {
		return StationNamesResponse.class;
	}

}
